package club.monkeywood.request.buyer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel(description = "创建订单对象OrderRequest")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderRequest {

    /** 名字. */
    @ApiModelProperty(value = "微信openid")
    @NotEmpty(message = "请登录")
    private String openid;

    //嵌套验证加@Valid，否则不回验证子对象
    @Valid
    @ApiModelProperty(value = "商品列表",example = "[{id:1,count:3},{id:2,count:4]")
    @NotNull(message = "购物车不能为空")
    private List<SelectedProductionRequest> productions;
}
